<template>
	<div class="demo1">
		<h2>我是Demo1组件</h2>
		<h4>我有台车：{{car}}</h4>
		<button @click="senCar2Brother">点我把车给我弟弟（Demo2）用</button>
	</div>
</template>

<script>
	export default {
		name:'Demo1',
		data() {
			return {
				car:'奔驰'
			}
		},
		methods: {
			senCar2Brother(){
				this.$bus.$emit('haha',this.car)
			}
		},
	}
</script>

<style scoped>
	.demo1{
		background-color: skyblue;
		padding: 20px;
	}
</style>